home *** CD-ROM | disk | FTP | other *** search
- // GETINFO SCRIPTING
- // Animeka.com - Recherche d'Animes (donnΘes, Θpisodes, et images) - by ScorEpioN
-
- (***************************************************
- * Script d'importation pour : *
- * Animeka , http://www.animeka.com *
- * *
- * Script by ScorEpioN *
- * *
- * Version : 17 - Update du 15/11/2004 *
- * *
- * A utiliser avec Ant Movie Catalog 3.4.0 *
- * www.ant.be.tf/moviecatalog ╖╖╖ www.buypin.com *
- * *
- * The source code of the script can be used in *
- * another program only if full credits to *
- * script author and a link to Ant Movie Catalog *
- * website are given in the About box or in *
- * the documentation of the program *
- ***************************************************)
-
- program ANIMEKA_SEARCH;
-
- const
- ConfirmTitre = 0;
- { 0: Demande le titre avant de lancer le script
- 1: Ne demande pas le titre avant de lancer le script , met aucun resultat dans adresse web, 2: idem et met rΘsutlats multiples }
- // Pour rΘcupΘrer ou non un champs
- TitreOrignalConst = True;
- TitreTraduitConst = True;
- RealisateurConst = True;
- StudioConst = True;
- PaysConst = True;
- CategorieConst = True;
- AnneeConst = True;
- DureeConst = True;
- AdresseWebConst = True;
- SynopsisConst = True;
- EpisodeConst = True;
-
- var
- MovieName, NomFilm, la_liste, premiere_pageEpisode, Reponse : string;
- premiereExecution : Integer;
-
- // Pour debug : showmessage();
-
- //------------------------------------------------------------------------------
- // ANALYSE DE LA PAGE DE RECHERCHES
- //------------------------------------------------------------------------------
-
- procedure AnalyzePage(Address: string);
- var
- Page: TStringList;
- LineNr: Integer;
- Line,page_film,titre_film, realisateur_film, annee_film : string;
- BeginPos, EndPos, compteur : Integer;
- begin
- //vide la liste des films
- PickTreeClear;
- //charge la page
- Line := GetPage(Address);
-
- //teste si il y a des films trouvΘs
- BeginPos := Pos('Aucuns r', Line);
- if BeginPos <> 0 then
- begin
- if (ConfirmTitre = 0) then
- begin
- titre_film := MovieName;
- titre_film := StringReplace(titre_film, #13#10, '');
- titre_film := StringReplace(titre_film, ' ', '');
- titre_film := Trim(titre_film);
- titre_film := AnsiLowerCase(titre_film);
- titre_film := AnsiUpFirstLetter(titre_film);
- showmessage('Aucun Anime trouvΘ pour : ' + titre_film);
- exit;
- end else
- begin
- SetField(fieldURL, 'Animeka : aucun rΘsultat');
- exit;
- end;
- end;
-
- //teste si on a ΘtΘ redirigΘ vers la fiche de l'anime
- BeginPos := Pos('<script language="javascript">document.location.href=', Line);
- if BeginPos <> 0 then
- begin
- Delete(Line, 1, BeginPos+53);
- EndPos := Pos('</script>',Line);
- page_film := 'http://www.animeka.com' + Copy(Line, 1, EndPos-2 );
- if (Pos('fansub',page_film) = 0) then
- begin
- AnalysePageFilm(page_film);
- exit;
- end else
- begin
- AnalyzePageFansub(page_film);
- exit;
- end;
- end;
-
- //introduction rΘsultats
- titre_film := MovieName;
- titre_film := StringReplace(titre_film, #13#10, '');
- titre_film := StringReplace(titre_film, ' ', '');
- titre_film := Trim(titre_film);
- titre_film := AnsiLowerCase(titre_film);
- titre_film := AnsiUpFirstLetter(titre_film);
- PickTreeAdd('Animes trouvΘs pour ' + titre_film + ' :', '');
-
- //compte les rΘsultats
- compteur := 0;
-
- repeat
- //cherche le lien de la page du film
- BeginPos := Pos('<a href="/animes/detail/',Line);
- Delete(Line, 1, BeginPos+8);
- EndPos := Pos('">',Line);
- page_film := 'http://www.animeka.com' + Copy(Line, 1, EndPos-1 );
- //cherche le nom du film
- BeginPos := Pos('">',Line);
- Delete(Line, 1, BeginPos+1);
- EndPos := Pos('</b></a>',Line)-1;
- titre_film := Copy(Line, 1, EndPos );
- HTMLdecode(titre_film);
- HTMLremovetags(titre_film);
- titre_film := StringReplace(titre_film, #13#10, '');
- titre_film := StringReplace(titre_film, ' ', '');
- titre_film := Trim(titre_film);
- titre_film := AnsiLowerCase(titre_film);
- titre_film := AnsiUpFirstLetter(titre_film);
- //ajoute les films
- PickTreeAdd(titre_film , page_film);
- compteur := compteur+1;
- //cherche le lien de la page du film
- BeginPos := Pos('/animes/detail/',Line);
- until BeginPos = 0;
- PickTreeAdd(' ', '');
- PickTreeAdd('Verifier si vous avez la derniΦre version', 'version');
-
- if compteur = 1 then
- begin
- compteur := 0;
- AnalysePageFilm(page_film);
- exit;
- end;
-
-
- if (ConfirmTitre = 0) or (ConfirmTitre = 1) then
- begin
- begin
- if PickTreeExec(Address)=true then
- begin
- if (Address = 'version') then
- begin
- verifVersion();
- end else
- begin
- AnalysePageFilm(Address);
- end;
- end;
- end;
- end else
- begin
- SetField(fieldURL, 'Animeka : rΘsultats multiples');
- exit;
- end;
-
- end;
-
- //------------------------------------------------------------------------------
- // ANALYSE DE LA PAGE FANSUB
- //------------------------------------------------------------------------------
-
- procedure AnalyzePageFansub(Address: string);
- var
- Line ,page_film : string;
- BeginPos, EndPos : Integer;
- begin
- Line := GetPage(Address);
- BeginPos := Pos('"animestitle"', Line);
- Delete(Line, 1, BeginPos);
- BeginPos := Pos('a href="', Line);
- Delete(Line, 1, BeginPos+7);
- EndPos := Pos('">',Line);
- page_film := 'http://www.animeka.com' + Copy(Line, 1, EndPos-1 );
- AnalysePageFilm(page_film);
- end;
-
- //------------------------------------------------------------------------------
- // VERIFIER LA VERSION DU SCRIPT
- //------------------------------------------------------------------------------
-
- procedure verifVersion();
- var
- Line, NewVersion, MaVersion, Telecharge : String;
- BeginPos, EndPos : Integer;
- begin
- MaVersion := '17';
- Line := GetPage('http://forum.antp.be/phpbb2/viewtopic.php?t=1453');
- BeginPos := pos('TELECHARGER LE SCRIPT ANIMEKA v', Line);
- delete(Line,1, BeginPos+30);
- EndPos := pos('du', Line);
- NewVersion := copy(Line, 1, EndPos - 2);
- PickTreeClear;
- PickTreeAdd('Votre version est la '+MaVersion+', la derniΦre est la '+NewVersion+'.', '');
- PickTreeAdd('Pour tΘlΘcharger la derniΦre version :', '');
- PickTreeAdd('Cliquez ici', 'DL');
- PickTreeAdd('Le script sera tΘlΘcharger dans le mΩme rΘpertoire que votre catalogue', '');
- PickTreeAdd('Cliquez sur annuler pour quitter', '');
- begin
- if PickTreeExec(Telecharge)=true then
- if (Telecharge = 'DL') then
- begin
- GetPicture('http://www.ifrance.com/ricoland/Animeka%20(FR).ifs', True);
- end else
- begin
- exit;
- end;
- end;
- end;
-
- //------------------------------------------------------------------------------
- // ANALYSE DE LA PAGE DU FILM
- //------------------------------------------------------------------------------
-
- procedure AnalysePageFilm(Address: string);
- var
- Line,page_film,titre_film,titre_original, categorie_film, realisateur_film, studio_film, annee_film: string;
- critique, noteRedaction, pays_film, url_film, duree_film, episode_anime, page_episodes, liste_episodes, acteurs_film, liste_acteurs, description_film, reference_film,public_film,video_film,audio_film,fichier_image,aucun:string;
- BeginPos, EndPos, i: Integer;
- begin
- //pause pour eviter les time out
- sleep(1500);
- //charge la page
- Line := GetPage(Address);
- url_film := Address;
-
- //cherche le nom du film
- BeginPos := Pos('"animestitle"', Line);
- Delete(Line, 1, BeginPos+39);
- EndPos := Pos('</td>',Line);
- titre_film := Copy(Line, 1, EndPos-1 );
- HTMLdecode(titre_film);
- HTMLremovetags(titre_film);
- titre_film := StringReplace(titre_film, #13#10, '');
- titre_film := StringReplace(titre_film, ' ', '');
- titre_film := Trim(titre_film);
- titre_film := AnsiLowerCase(titre_film);
- titre_film := AnsiMixedCase(titre_film, ' -');
- titre_film := nettoieTitre(titre_film);
-
- //chargement des jaquettes
- BeginPos := Pos('<img class="picture" src=', Line);
- if BeginPos <> 0 then
- begin
- Delete(Line, 1, BeginPos+26);
- EndPos := Pos(' width',Line);
- fichier_image := 'http://www.animeka.com/' + Copy(Line, 1, EndPos-2 );
- //pour eviter les time-out
- sleep(1500);
- GetPicture(fichier_image, false);
- end;
-
- //cherche le titre original
- BeginPos := Pos('<td class="animestxt"> ', Line);
- Delete(Line, 1, BeginPos+50);
- EndPos := Pos('</td>',Line);
- titre_original := Copy(Line, 1, EndPos-1 );
- HTMLdecode(titre_original);
- HTMLremovetags(titre_original);
- titre_original := StringReplace(titre_original, #13#10, '');
- titre_original := StringReplace(titre_original, ' ', '');
- titre_original := Trim(titre_original);
- titre_original := AnsiLowerCase(titre_original);
- titre_original := AnsiMixedCase(titre_original, ' ');
- titre_original := AnsiMixedCase(titre_original, '-');
-
- //cherche l'annΘe
- BeginPos := Pos('<tr><td class="animestxt"> ', Line);
- Delete(Line, 1, BeginPos+66);
- EndPos := Pos('</td>',Line);
- annee_film := Copy(Line, 1, EndPos-1 );
- duree_film := '';
- i:=pos('-',annee_film);
- if i <> 0 then
- begin
- duree_film := #13#10#13#10 + 'ANN╔ES DE PRODUCTION : ' + annee_film;
- annee_film := copy(annee_film,1,i-1);
- annee_film := Trim(annee_film);
- end;
-
- //cherche le studio
- BeginPos := Pos('STUDIO', Line);
- Delete(Line, 1, BeginPos+8);
- EndPos := Pos('</td></tr>',Line);
- studio_film := Copy(Line, 1, EndPos-1 );
- HTMLRemoveTags(studio_film);
- HTMLdecode(studio_film);
- studio_film := StringReplace(studio_film, #13#10, '');
- studio_film := StringReplace(studio_film, ' ', '');
- studio_film := StringReplace(studio_film, '] [', ' - ');
- studio_film := StringReplace(studio_film, '[', '');
- studio_film := StringReplace(studio_film, ']', '');
- studio_film := Trim(studio_film);
- studio_film := AnsiLowerCase(studio_film);
- studio_film := AnsiMixedCase(studio_film, ' -');
-
- //cherche la catΘgorie
- BeginPos := Pos('GENRE', Line);
- Delete(Line, 1, BeginPos+8);
- EndPos := Pos('</td></tr>',Line);
- categorie_film := Copy(Line, 1, EndPos-1);
- HTMLRemoveTags(categorie_film);
- HTMLdecode(categorie_film);
- categorie_film := StringReplace(categorie_film, #13#10, '');
- categorie_film := StringReplace(categorie_film, ' ', '');
- categorie_film := StringReplace(categorie_film, '] [', ' - ');
- categorie_film := StringReplace(categorie_film, '[', '');
- categorie_film := StringReplace(categorie_film, ']', '');
- categorie_film := Trim(categorie_film);
- categorie_film := AnsiLowerCase(categorie_film);
- categorie_film := AnsiMixedCase(categorie_film, ' -');
-
- //cherche le rΘalisateur
- BeginPos := Pos('AUTEUR : ', Line);
- Delete(Line, 1, (BeginPos-1));
- aucun := Copy(Line, 10, 3 );
- if aucun = 'Non' then
- begin
- realisateur_film := 'Non SpΘcifiΘ';
- end else
- begin
- BeginPos := Pos('.html">', Line);
- Delete(Line, 1, BeginPos+6);
- EndPos := Pos('</a>',Line);
- realisateur_film := Copy(Line, 1, EndPos-1 );
- HTMLdecode(realisateur_film);
- realisateur_film := StringReplace(realisateur_film, #13#10, '');
- realisateur_film := StringReplace(realisateur_film, ' ', '');
- realisateur_film := Trim(realisateur_film);
- realisateur_film := AnsiLowerCase(realisateur_film);
- realisateur_film := AnsiMixedCase(realisateur_film, ' ');
- realisateur_film := AnsiMixedCase(realisateur_film, '-');
- end;
-
- //cherche la durΘe
- BeginPos := Pos('DUR', Line);
- Delete(Line, 1, BeginPos-1);
- EndPos := Pos('</td></tr>',Line);
- duree_film := Copy(Line, 1, EndPos-1 ) + duree_film;
- HTMLdecode(duree_film);
- duree_film := StringReplace(duree_film, ' ', '');
- duree_film := Trim(duree_film);
- // durΘe dans le champs durΘe
- aucun := duree_film;
- BeginPos := Pos('mins',aucun);
- delete(aucun,1,BeginPos-6);
- BeginPos := Pos(' ',aucun);
- EndPos := Pos(' mins',aucun);
- aucun := copy(aucun,BeginPos+1,EndPos-BeginPos-1);
- aucun := Trim(aucun);
- if aucun <> '' then
- if DureeConst = True then
- SetField(fieldLength,aucun);
-
- //cherche le pays
- BeginPos := Pos('show_flag.php', Line);
- Delete(Line, 1, BeginPos);
- BeginPos := Pos('alt=', Line);
- Delete(Line, 1, BeginPos+4);
- EndPos := Pos('"',Line);
- pays_film := Copy(Line, 1, EndPos-1 );
- HTMLdecode(pays_film);
- pays_film := StringReplace(pays_film, #13#10, '');
- pays_film := StringReplace(pays_film, ' ', '');
- pays_film := Trim(pays_film);
- HTMLremovetags(pays_film);
- pays_film := AnsiLowerCase(pays_film);
- pays_film := AnsiMixedCase(pays_film, ' ');
- pays_film := AnsiMixedCase(pays_film, '-');
-
- //cherche la description
- BeginPos := Pos('Synopsis', Line);
- Delete(Line, 1, BeginPos+126);
- aucun := Copy(Line, 10, 3 );
- if aucun = 'sp;' then
- begin
- aucun := 'Pas de description pour le moment';
- end else
- begin
- EndPos := Pos('</td></tr></table></td></tr>',Line)-1;
- description_film := Copy(Line, 1, EndPos );
- HTMLdecode(description_film);
- description_film := StringReplace(description_film, #13#10, '');
- description_film := StringReplace(description_film, '<br />',#13#10);
- description_film := StringReplace(description_film, '<b>', '');
- description_film := StringReplace(description_film, '</b>', '');
- description_film := StringReplace(description_film, '<i>', '');
- description_film := StringReplace(description_film, '</i>', '');
- description_film := StringReplace(description_film, ' ', ' ');
- description_film := StringReplace(description_film, '</div>', ' ');
- description_film := StringReplace(description_film, '<div class="u">', '');
- description_film := deleteBalise(description_film);
- end;
-
- //cherche les critiques
- BeginPos := Pos('Critiques', Line);
- Delete(Line, 1, BeginPos);
- if BeginPos = 0 then
- begin
- critique := 'Pas de critiques pour le moment';
- end else
- begin
- BeginPos := Pos('<td class="animestxt">', Line);
- Delete(Line, 1, BeginPos+21);
- EndPos := Pos('</td></tr></table></td></tr>',Line);
- critique := 'Critiques : ';
- critique := critique + Copy(Line, 1, EndPos-1 );
- HTMLdecode(critique);
- critique := StringReplace(critique, #13#10, ' ');
- critique := StringReplace(critique, '<br />', ' ');
- critique := StringReplace(critique, '<b>', '');
- critique := StringReplace(critique, '</b>', '');
- critique := StringReplace(critique, '<i>', '');
- critique := StringReplace(critique, '</i>', '');
- critique := StringReplace(critique, ' ', ' ');
- critique := deleteBalise(critique);
- description_film := description_film + #13#10#13#10 + critique;
- end;
-
- //cherche la note de la rΘdaction
- BeginPos := Pos('Note de la rΘdaction', Line);
- Delete(Line, 1, BeginPos);
- if BeginPos = 0 then
- begin
- noteRedaction := 'Pas de note de la rΘdaction pour le moment';
- end else
- begin
- BeginPos := Pos('<td class="animestxt">', Line);
- Delete(Line, 1, BeginPos+21);
- EndPos := Pos('</td></tr></table></td></tr>',Line);
- noteRedaction := 'Note de la rΘdaction : ';
- noteRedaction := noteRedaction + Copy(Line, 1, EndPos-1 );
- HTMLdecode(noteRedaction);
- noteRedaction := StringReplace(noteRedaction, #13#10, ' ');
- noteRedaction := StringReplace(noteRedaction, '<br />', ' ');
- noteRedaction := StringReplace(noteRedaction, '<b>', '');
- noteRedaction := StringReplace(noteRedaction, '</b>', '');
- noteRedaction := StringReplace(noteRedaction, '<i>', '');
- noteRedaction := StringReplace(noteRedaction, '</i>', '');
- noteRedaction := StringReplace(noteRedaction, ' ', ' ');
- noteRedaction := deleteBalise(noteRedaction);
- description_film := description_film + #13#10#13#10 + noteRedaction;
- end;
-
- //cherche les Θpisodes
- BeginPos := Pos('/animes/epis/', Line);
- Delete(Line, 1, BeginPos-1);
- if BeginPos = 0 then
- begin
- aucun := 'Pas de listing d''Θpisodes pour le moment';
- end else
- begin
- EndPos := Pos('" class',Line);
- page_episodes := 'http://www.animeka.com'+Copy(Line, 1, EndPos-1 );
- premiere_pageEpisode := page_episodes;
- liste_episodes := 'Liste des Θpisodes'+#13#10#13#10;
- la_liste := '';
- TrouveEpisode(page_episodes);
- liste_episodes := liste_episodes + la_liste;
- end;
-
- //charge les rΘsultats dans la fenΩtre
- if TitreTraduitConst = True then
- SetField( fieldTranslatedTitle,titre_film);
- if TitreOrignalConst = True then
- SetField( fieldOriginalTitle,titre_original);
- if titre_original = '' then
- begin
- if TitreOrignalConst = True
- SetField( fieldOriginalTitle,titre_film);
- end;
- if AdresseWebConst = True then
- SetField( fieldURL,url_film);
- if CategorieConst = True then
- SetField( fieldCategory,categorie_film);
- if RealisateurConst = True then
- SetField( fieldDirector,realisateur_film);
- if AnneeConst = True then
- SetField( fieldYear,annee_film);
- if PaysConst = True then
- SetField( fieldCountry,pays_film);
- if DureeConst = True then
- SetField( fieldActors,duree_film);
- if SynopsisConst = True then
- SetField( fieldDescription,description_film);
- if StudioConst = True then
- SetField( fieldProducer,studio_film);
- if EpisodeConst = True then
- SetField( fieldComments,liste_episodes);
- DisplayResults;
- end;
-
- //------------------------------------------------------------------------------
- // ANALYSE DE LA PAGE DES EPISODES
- //------------------------------------------------------------------------------
-
- procedure TrouveEpisode(page_episodes: string);
- var
- Line, episode_anime, liste_episodes, aucun, resume, titre_episode:string;
- BeginPos, EndPos, i: Integer;
- begin
- //pour eviter les time-out
- sleep(1500);
- //charge la page
- Line := GetPage(page_episodes);
- //compteur
- i := 0;
- //liste les Θpisodes
- repeat
- i := i+1;
- BeginPos := Pos('<td class="animestitle" style="padding-left:5px" >', Line);
- Delete(Line, 1, BeginPos+49);
- EndPos := Pos('</td></tr>',Line);
- aucun := Copy(Line, 1, 1 );
- //pour n'avoir que les Θpisodes
- if aucun = '<' then
- begin
- exit;
- end else
- begin
- //NumΘro et titre Θpisode
- titre_episode := Copy(Line, 1, EndPos-1 );
- titre_episode := deleteKanji(titre_episode);
- titre_episode := StringReplace(titre_episode, #13#10,'');
- la_liste := la_liste + titre_episode + #13#10;
- //Pour le rΘsumΘ
- BeginPos := Pos('<table cellspacing="5" width="100%"><tr><td class="animestxt">', Line);
- Delete(Line, 1, BeginPos+62);
- EndPos := Pos('</td></tr></table>',Line);
- resume := Copy(Line, 1, EndPos-1 );
- resume := StringReplace(resume, '<br />',' ');
- resume := StringReplace(resume, #13#10,' ');
- if resume <> '' then
- begin
- la_liste := la_liste + resume + #13#10#13#10;
- end;
- end;
- until i = 25;
-
- //Si 25 Θpisodes et + alors page suivante
- if i = 25 then
- begin
- BeginPos := Pos('<td class="animestitle" style="padding-left:5px" >', Line);
- Delete(Line, 1, BeginPos+49);
- EndPos := Pos('</td></tr>',Line);
- aucun := Copy(Line, 1, 1 );
- //Si il y a juste 25 Θpisodes
- if aucun = '<' then
- begin
- exit;
- end else
- begin
- //NumΘro et titre Θpisode
- titre_episode := Copy(Line, 1, EndPos-1 );
- titre_episode := deleteKanji(titre_episode);
- la_liste := la_liste + titre_episode + #13#10;
- //Pour le rΘsumΘ
- BeginPos := Pos('<table cellspacing="5" width="100%"><tr><td class="animestxt">', Line);
- Delete(Line, 1, BeginPos+62);
- EndPos := Pos('</td></tr></table>',Line);
- resume := Copy(Line, 1, EndPos-1 );
- resume := StringReplace(resume, '<br />',' ');
- resume := StringReplace(resume, #13#10,' ');
- if resume <> '' then
- begin
- la_liste := la_liste + resume + #13#10#13#10;
- end;
- //cherche la page suivante
- BeginPos := Pos('PrΘcΘdent', Line);
- Delete(Line, 1, BeginPos+9);
- BeginPos := Pos('/animes/epis/', Line);
- if BeginPos <> 0 then
- begin
- Delete(Line, 1, BeginPos-1);
- EndPos := Pos('">',Line);
- page_episodes := 'http://www.animeka.com'+Copy(Line, 1, EndPos-1 );
- if page_episodes <> premiere_pageEpisode then
- begin
- TrouveEpisode(page_episodes);
- end;
- end;
- end;
- end;
- end;
-
- //------------------------------------------------------------------------------
- // SUPPRESSION DES BALISES
- //------------------------------------------------------------------------------
-
- function deleteBalise (la_ligne : String) : string;
- var
- i,j, fin : Integer;
- la_chaine_sans_balise, aucun : String;
- begin
- la_chaine_sans_balise := '';
- fin := Length(la_ligne);
- repeat
- i := pos('<',la_ligne);
- if i <> 0 then
- begin
- aucun := copy(la_ligne,i+1,fin);
- delete(aucun,2,fin);
- //pour Ωtre s√r d'avoir affaire α une balise
- if aucun = ' ' then
- begin
- la_chaine_sans_balise := la_chaine_sans_balise + copy (la_ligne,1,i);
- delete(la_ligne,1,i);
- end else
- begin
- j := pos('>',la_ligne);
- fin := Length(la_ligne);
- la_chaine_sans_balise := la_chaine_sans_balise + copy (la_ligne,1,i-1);
- delete(la_ligne,1,j);
- end;
- end;
- until i = 0;
- fin := Length(la_ligne);
- la_chaine_sans_balise := la_chaine_sans_balise + copy (la_ligne,1,fin);
- result := la_chaine_sans_balise;
- end;
-
- //------------------------------------------------------------------------------
- // SUPPRESSION DES CARACTERES JAPONAIS DANS LES NOMS D'EPISODES
- //------------------------------------------------------------------------------
-
- function deleteKanji (la_ligne : String) : string;
- var
- i : Integer;
- begin
- i:=pos('',la_ligne); // ces symboles caractΘrisent un caractΦre asiatique
- if i <> 0 then
- begin
- la_ligne := copy(la_ligne,1,i-2);
- end;
- result := la_ligne;
- end;
-
- //------------------------------------------------------------------------------
- // NETTOIE TITRE
- //------------------------------------------------------------------------------
-
- function nettoieTitre(le_titre : String) : string;
- var
- i : Integer;
- begin
- i:=pos('(1',le_titre);
- if i <> 0 then
- begin
- le_titre := copy(le_titre,1,i-1);
- le_titre := Trim(le_titre);
- result := le_titre;
- end;
- i:= 0;
- i:=pos('(2',le_titre);
- if i <> 0 then
- begin
- le_titre := copy(le_titre,1,i-1);
- le_titre := Trim(le_titre);
- result := le_titre;
- end else
- result := le_titre;
- end;
-
- //------------------------------------------------------------------------------
- // NETTOIE LE TITRE DU FICHIER POUR AVOIR LE TITRE DE FILM
- //------------------------------------------------------------------------------
-
- function cleanTitle(title : String) : string;
- var
- i,j, fin : Integer;
- temp : String;
-
- begin
- title := AnsiUpperCase(title);
-
- if title <> '' then
- begin
- // Nettoie les tags fichiers, merci Atmosfear pour les tags
- i:=pos('.DVD',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.DIVX',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.FREN',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.GERM',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.INT',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.LIM',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.PROP',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.REPACK',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.SUBB',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.UNSUB',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.WS',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.XVID',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.AC3',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
- i:=pos('.UNRAT',title);
- if i <> 0 then
- begin
- title := copy(title,1,i-1);
- end;
-
- title := StringReplace(title, '.', ' ');
- title := StringReplace(title, ',', ' ');
- title := StringReplace(title, ':', '');
- title := StringReplace(title, '-', '');
- title := StringReplace(title, ' ', ' ');
-
- i := 0;
- // Nettoie les tags de team
- if (pos('(',title) <> 0) then
- begin
- i := pos('(',title);
- temp := copy(title,0,i-1);
- j := pos(')',title);
- fin := Length(title);
- title := temp + copy(title,j+1,fin);
- end;
-
- if (pos('[',title) <> 0) then
- begin
- i := pos('[',title);
- temp := copy(title,1,i-1);
- j := pos(']',title);
- fin := Length(title);
- title := temp + copy(title,j+1,fin);
- end;
-
- title := AnsiLowerCase(title);
- title := AnsiUpFirstLetter(title);
- title := AnsiMixedCase(title,' -');
- end;
- result := title;
- end;
-
- //------------------------------------------------------------------------------
- // PROGRAMME PRINCIPAL
- //------------------------------------------------------------------------------
-
- begin
- if CheckVersion(3,4,0) then
- begin
- NomFilm := GetField(fieldTranslatedTitle);
- if NomFilm = '' then
- NomFilm := GetField(fieldOriginalTitle);
- NomFilm := cleanTitle(NomFilm);
- if (ConfirmTitre = 0) then
- begin
- if Input('Animeka avec Image by ScorEpioN', 'Entrez le titre de l''anime :', NomFilm) then
- begin
- if Pos('animeka.com', NomFilm) > 0 then
- begin
- AnalysePageFilm(NomFilm);
- end else
- begin
- //remplace les caractΦres accentuΘs
- MovieName := NomFilm;
- NomFilm := AnsiLowerCase(NomFilm);
- NomFilm := StringReplace(NomFilm, 'Θ', 'e');
- NomFilm := StringReplace(NomFilm, 'Φ', 'e');
- NomFilm := StringReplace(NomFilm, 'α', 'a');
- NomFilm := StringReplace(NomFilm, 'τ', 'c');
- NomFilm := StringReplace(NomFilm, '∙', 'u');
- NomFilm := StringReplace(NomFilm, ' ', '+');
- NomFilm := 'http://www.animeka.com/search/index.html?req='+ UrlEncode(NomFilm)+'&zone_series=1&go_search=1&cat=search';
- AnalyzePage(NomFilm);
- end;
- end;
- end else
- begin
- MovieName := NomFilm;
- NomFilm := AnsiLowerCase(NomFilm);
- NomFilm := StringReplace(NomFilm, 'Θ', 'e');
- NomFilm := StringReplace(NomFilm, 'Φ', 'e');
- NomFilm := StringReplace(NomFilm, 'α', 'a');
- NomFilm := StringReplace(NomFilm, 'τ', 'c');
- NomFilm := StringReplace(NomFilm, '∙', 'u');
- NomFilm := StringReplace(NomFilm, ' ', '+');
- if (premiereExecution = 0) then
- begin
- premiereExecution := -1;
- PickTreeClear;
- PickTreeAdd('Vous allez executer le script Animeka sans confirmation', '');
- PickTreeAdd('Cliquez ici pour continuer', 'Oui');
- PickTreeAdd('Cliquez sur annuler pour ne pas executer le script', '');
- begin
- if PickTreeExec(Reponse)=true then
- if (Reponse = 'Oui') then
- begin
- AnalyzePage('http://www.animeka.com/search/index.html?req='+ UrlEncode(NomFilm)+'&zone_series=1&go_search=1&cat=search');
- end;
- end;
- end else
- begin
- AnalyzePage('http://www.animeka.com/search/index.html?req='+ UrlEncode(NomFilm)+'&zone_series=1&go_search=1&cat=search');
- end;
- end;
- end else
- ShowMessage('Ce script requiert une version plus rΘcente de Ant Movie Catalog (au moins la version 3.4.0)');
- end.
-